<?php
	class modele_Connexion extends DBMapper{

		function connexion($pseudo,$mdp){
			
			$selecPreparee = self::$database->prepare("SELECT idUtilisateur FROM Utilisateur WHERE pseudo = ? AND mdp = ?");	
			$selecPreparee->execute(array($pseudo,sha1($mdp)));
            $tableauArgs = $selecPreparee->fetch();	
			if(!isset($tableauArgs[0])){
				return 0;
			}
			else{
				
				$_SESSION['idConnecte']=$tableauArgs[0];
				return 1;
			}
		}
		function deconnexion(){
			session_destroy();
		}

	}
?>